export const setStorage = (key: string, value: object | string) => {
  if(typeof value === 'object'){
    window.localStorage.setItem(key, JSON.stringify(value))
  }else{
    window.localStorage.setItem(key, value)
  }

}

export const getStorage = (key: string) => {
  return localStorage.getItem(key)
}

export const getStorageObj = (key: string) => {
  const temp = localStorage.getItem(key) || '{}'
  return JSON.parse(temp)
}

export const removeStorage = (key: string) => {
  localStorage.removeItem(key)
}